import { createRouter, createWebHistory } from 'vue-router'
import Cart from '@/views/cart.vue'
import Cla from '@/views/cla.vue'
import Home from '@/views/home.vue'
import Index from '@/views/index.vue'
import Look from '@/views/look.vue'
import My from '@/views/my.vue'
import Search from '@/views/search.vue'
import Goods from '@/views/goods.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/', redirect: '/index/home' },
    {
      path: '/index', name: 'index', component: Index, children: [
        { path: 'home', name: 'home', component: Home, },
        { path: 'look', name: 'look', component: Look, },
        { path: 'cla', name: 'cla', component: Cla, },
        { path: 'cart', name: 'cart', component: Cart, },
        { path: 'my', name: 'my', component: My, },
      ]
    },
      { path: '/search', name: 'search', component: Search, },
      { path: '/goods/:query', name: 'goods', component: Goods, },

  ],
})

export default router
